package com.kgc.ljp.InputStream;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class DataInDemo {
    public static void main(String[] args)
            throws IOException{

        String file = "data.dat";

        InputStream in = new FileInputStream(file);
        //DataInputStream 从基本流中读取基本类型数据,实现基本
        //类型数据的反序列化
        DataInputStream dis = new DataInputStream(in);
        int b = dis.read();
        int i = dis.readInt();
        long l= dis.readLong();
        byte bx = dis.readByte();
        double d = dis.readDouble();
        short s = dis.readShort();
        float f = dis.readFloat();
        boolean bol = dis.readBoolean();
        char c = dis.readChar();
        dis.close();
        System.out.print( b +" ");//254  fe
        System.out.print(i+" ");
        System.out.print(l+" ");
        System.out.print(bx+" ");
        System.out.print(d+" ");
        System.out.print(s+" ");
        System.out.print(f+" ");
        System.out.print(bol+" ");
        System.out.print(c+" ");

    }
}
